package com.fwtai.web;

import com.fwtai.bean.PageFormData;
import com.fwtai.datasource.DaoHandle;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
 * 产品展示访问数据库
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2024-02-05 18:34:58
 * @QQ号码 444141300
 * @Email service@fwtai.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Repository
public class ProductShowDao{

  private final DaoHandle dao;

  public ProductShowDao(final DaoHandle dao){
    this.dao = dao;
  }

  public int add(final PageFormData formData){
    return dao.execute("product_show.add",formData);
  }

  public int edit(final PageFormData formData){
    return dao.execute("product_show.edit",formData);
  }

  public HashMap<String,String> queryExistById(final long kid){
    return dao.queryForHashMapString("product_show.queryExistById",kid);
  }

  public List<HashMap<String,String>> queryFiles(final long[] lists){
    return dao.queryForListString("product_show.queryFiles",lists);
  }

  public HashMap<String,Object> queryById(final long kid){
    return dao.queryForHashMap("product_show.queryById",kid);
  }

  public int delById(final long kid){
    return dao.execute("product_show.delById",kid);
  }

  public int delByKeys(final long[] list){
    return dao.execute("product_show.delByKeys",list);
  }

  public List<HashMap<String,Object>> getListData(final PageFormData formData){
    return dao.queryForListHashMap("product_show.listData",formData);
  }

  public Integer getListTotal(final PageFormData formData){
    return dao.queryForInteger("product_show.listTotal",formData);
  }
}